<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionController::Dispatcher</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionController::Dispatcher</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_controller/dispatcher_rb.html">
                vendor/rails/actionpack/lib/action_controller/dispatcher.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Dispatches requests to the appropriate controller and takes care of
reloading the app after each request when Dependencies.load? is true.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000466">after_dispatch</a>&nbsp;&nbsp;
      <a href="#M000465">before_dispatch</a>&nbsp;&nbsp;
      <a href="#M000474">cleanup_application</a>&nbsp;&nbsp;
      <a href="#M000464">dispatch</a>&nbsp;&nbsp;
      <a href="#M000470">dispatch</a>&nbsp;&nbsp;
      <a href="#M000471">dispatch_cgi</a>&nbsp;&nbsp;
      <a href="#M000478">failsafe_rescue</a>&nbsp;&nbsp;
      <a href="#M000468">failsafe_response</a>&nbsp;&nbsp;
      <a href="#M000475">flush_logger</a>&nbsp;&nbsp;
      <a href="#M000476">handle_request</a>&nbsp;&nbsp;
      <a href="#M000469">new</a>&nbsp;&nbsp;
      <a href="#M000473">prepare_application</a>&nbsp;&nbsp;
      <a href="#M000472">reload_application</a>&nbsp;&nbsp;
      <a href="#M000477">run_callbacks</a>&nbsp;&nbsp;
      <a href="#M000467">to_prepare</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000466" class="method-detail">
        <a name="M000466"></a>

        <div class="method-heading">
          <a href="#M000466" class="method-signature">
          <span class="method-name">after_dispatch</span><span class="method-args">(*method_names, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Declare a block to be called after each <a
href="Dispatcher.html#M000464">dispatch</a>. Run in reverse of the order
declared.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000466-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000466-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 21</span>
21:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">after_dispatch</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">method_names</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
22:         <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:after</span>].<span class="ruby-identifier">concat</span> <span class="ruby-identifier">method_names</span>
23:         <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:after</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
24:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000465" class="method-detail">
        <a name="M000465"></a>

        <div class="method-heading">
          <a href="#M000465" class="method-signature">
          <span class="method-name">before_dispatch</span><span class="method-args">(*method_names, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Declare a block to be called before each <a
href="Dispatcher.html#M000464">dispatch</a>. Run in the order declared.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000465-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000465-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 14</span>
14:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">before_dispatch</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">method_names</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15:         <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:before</span>].<span class="ruby-identifier">concat</span> <span class="ruby-identifier">method_names</span>
16:         <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:before</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
17:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000464" class="method-detail">
        <a name="M000464"></a>

        <div class="method-heading">
          <a href="#M000464" class="method-signature">
          <span class="method-name">dispatch</span><span class="method-args">(cgi = nil, session_options = CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Backward-compatible class method takes CGI-specific args. Deprecated in
favor of <a href="Dispatcher.html#M000469">Dispatcher.new</a>(output,
request, response).<a href="Dispatcher.html#M000464">dispatch</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000464-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000464-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 8</span>
 8:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">cgi</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">session_options</span> = <span class="ruby-constant">CgiRequest</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_SESSION_OPTIONS</span>, <span class="ruby-identifier">output</span> = <span class="ruby-identifier">$stdout</span>)
 9:         <span class="ruby-identifier">new</span>(<span class="ruby-identifier">output</span>).<span class="ruby-identifier">dispatch_cgi</span>(<span class="ruby-identifier">cgi</span>, <span class="ruby-identifier">session_options</span>)
10:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000468" class="method-detail">
        <a name="M000468"></a>

        <div class="method-heading">
          <a href="#M000468" class="method-signature">
          <span class="method-name">failsafe_response</span><span class="method-args">(fallback_output, status, originating_exception = nil) {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If the block raises, send status code as a last-ditch response.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000468-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000468-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 48</span>
48:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failsafe_response</span>(<span class="ruby-identifier">fallback_output</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">originating_exception</span> = <span class="ruby-keyword kw">nil</span>)
49:         <span class="ruby-keyword kw">yield</span>
50:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>
51:         <span class="ruby-keyword kw">begin</span>
52:           <span class="ruby-identifier">log_failsafe_exception</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">originating_exception</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">exception</span>)
53:           <span class="ruby-identifier">body</span> = <span class="ruby-identifier">failsafe_response_body</span>(<span class="ruby-identifier">status</span>)
54:           <span class="ruby-identifier">fallback_output</span>.<span class="ruby-identifier">write</span> <span class="ruby-node">&quot;Status: #{status}\r\nContent-Type: text/html\r\n\r\n#{body}&quot;</span>
55:           <span class="ruby-keyword kw">nil</span>
56:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">failsafe_error</span> <span class="ruby-comment cmt"># Logger or IO errors</span>
57:           <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Error during failsafe response: #{failsafe_error}&quot;</span>
58:           <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;(originally #{originating_exception})&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">originating_exception</span>
59:         <span class="ruby-keyword kw">end</span>
60:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000469" class="method-detail">
        <a name="M000469"></a>

        <div class="method-heading">
          <a href="#M000469" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(output, request = nil, response = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000469-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000469-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 109</span>
109:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">request</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">response</span> = <span class="ruby-keyword kw">nil</span>)
110:       <span class="ruby-ivar">@output</span>, <span class="ruby-ivar">@request</span>, <span class="ruby-ivar">@response</span> = <span class="ruby-identifier">output</span>, <span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>
111:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000467" class="method-detail">
        <a name="M000467"></a>

        <div class="method-heading">
          <a href="#M000467" class="method-signature">
          <span class="method-name">to_prepare</span><span class="method-args">(identifier = nil, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Add a preparation callback. Preparation callbacks are run before every
request in development mode, and before the first request in production
mode.
</p>
<p>
An optional identifier may be supplied for the callback. If provided, <a
href="Dispatcher.html#M000467">to_prepare</a> may be called again with the
same identifier to replace the existing callback. Passing an identifier is
a suggested practice if the code adding a preparation block may be
reloaded.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000467-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000467-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 34</span>
34:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_prepare</span>(<span class="ruby-identifier">identifier</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
35:         <span class="ruby-comment cmt"># Already registered: update the existing callback</span>
36:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">identifier</span>
37:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback</span> = <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:prepare</span>].<span class="ruby-identifier">assoc</span>(<span class="ruby-identifier">identifier</span>)
38:             <span class="ruby-identifier">callback</span>[<span class="ruby-value">1</span>] = <span class="ruby-identifier">block</span>
39:           <span class="ruby-keyword kw">else</span>
40:             <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:prepare</span>] <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">identifier</span>, <span class="ruby-identifier">block</span>]
41:           <span class="ruby-keyword kw">end</span>
42:         <span class="ruby-keyword kw">else</span>
43:           <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">:prepare</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">block</span>
44:         <span class="ruby-keyword kw">end</span>
45:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000474" class="method-detail">
        <a name="M000474"></a>

        <div class="method-heading">
          <a href="#M000474" class="method-signature">
          <span class="method-name">cleanup_application</span><span class="method-args">(force = false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Cleanup the application by clearing out loaded classes so they can be
reloaded on the next request without restarting the server.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000474-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000474-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 156</span>
156:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup_application</span>(<span class="ruby-identifier">force</span> = <span class="ruby-keyword kw">false</span>)
157:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">load?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">force</span>
158:         <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">reset_subclasses</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">ActiveRecord</span>)
159:         <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">clear</span>
160:         <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">clear_reloadable_connections!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">ActiveRecord</span>)
161:       <span class="ruby-keyword kw">end</span>
162:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000470" class="method-detail">
        <a name="M000470"></a>

        <div class="method-heading">
          <a href="#M000470" class="method-signature">
          <span class="method-name">dispatch</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000470-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000470-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 113</span>
113:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>
114:       <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:before</span>
115:       <span class="ruby-identifier">handle_request</span>
116:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>
117:       <span class="ruby-identifier">failsafe_rescue</span> <span class="ruby-identifier">exception</span>
118:     <span class="ruby-keyword kw">ensure</span>
119:       <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:after</span>, <span class="ruby-identifier">:reverse_each</span>
120:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000471" class="method-detail">
        <a name="M000471"></a>

        <div class="method-heading">
          <a href="#M000471" class="method-signature">
          <span class="method-name">dispatch_cgi</span><span class="method-args">(cgi, session_options)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000471-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000471-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 122</span>
122:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch_cgi</span>(<span class="ruby-identifier">cgi</span>, <span class="ruby-identifier">session_options</span>)
123:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cgi</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">failsafe_response</span>(<span class="ruby-ivar">@output</span>, <span class="ruby-value str">'400 Bad Request'</span>) { <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">new</span> }
124:         <span class="ruby-ivar">@request</span> = <span class="ruby-constant">CgiRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cgi</span>, <span class="ruby-identifier">session_options</span>)
125:         <span class="ruby-ivar">@response</span> = <span class="ruby-constant">CgiResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cgi</span>)
126:         <span class="ruby-identifier">dispatch</span>
127:       <span class="ruby-keyword kw">end</span>
128:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception</span>
129:       <span class="ruby-identifier">failsafe_rescue</span> <span class="ruby-identifier">exception</span>
130:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000475" class="method-detail">
        <a name="M000475"></a>

        <div class="method-heading">
          <a href="#M000475" class="method-signature">
          <span class="method-name">flush_logger</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000475-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000475-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 164</span>
164:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flush_logger</span>
165:       <span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">flush</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">RAILS_DEFAULT_LOGGER</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:flush</span>)
166:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000473" class="method-detail">
        <a name="M000473"></a>

        <div class="method-heading">
          <a href="#M000473" class="method-signature">
          <span class="method-name">prepare_application</span><span class="method-args">(force = false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000473-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000473-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 139</span>
139:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepare_application</span>(<span class="ruby-identifier">force</span> = <span class="ruby-keyword kw">false</span>)
140:       <span class="ruby-keyword kw">begin</span>
141:         <span class="ruby-identifier">require_dependency</span> <span class="ruby-value str">'application'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">ApplicationController</span>)
142:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>
143:         <span class="ruby-identifier">raise</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">error</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/application\.rb/</span>
144:       <span class="ruby-keyword kw">end</span>
145: 
146:       <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">verify_active_connections!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">ActiveRecord</span>)
147: 
148:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">unprepared</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">force</span>
149:         <span class="ruby-identifier">run_callbacks</span> <span class="ruby-identifier">:prepare</span>
150:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unprepared</span> = <span class="ruby-keyword kw">false</span>
151:       <span class="ruby-keyword kw">end</span>
152:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000472" class="method-detail">
        <a name="M000472"></a>

        <div class="method-heading">
          <a href="#M000472" class="method-signature">
          <span class="method-name">reload_application</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000472-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000472-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 132</span>
132:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload_application</span>
133:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Dependencies</span>.<span class="ruby-identifier">load?</span>
134:         <span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>.<span class="ruby-identifier">reload</span>
135:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unprepared</span> = <span class="ruby-keyword kw">true</span>
136:       <span class="ruby-keyword kw">end</span>
137:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000478" class="method-detail">
        <a name="M000478"></a>

        <div class="method-heading">
          <a href="#M000478" class="method-signature">
          <span class="method-name">failsafe_rescue</span><span class="method-args">(exception)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000478-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000478-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 185</span>
185:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">failsafe_rescue</span>(<span class="ruby-identifier">exception</span>)
186:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">failsafe_response</span>(<span class="ruby-ivar">@output</span>, <span class="ruby-value str">'500 Internal Server Error'</span>, <span class="ruby-identifier">exception</span>) <span class="ruby-keyword kw">do</span>
187:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@controller</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">ApplicationController</span>) <span class="ruby-operator">?</span> <span class="ruby-operator">::</span><span class="ruby-constant">ApplicationController</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Base</span>
188:             <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">process_with_exception</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-ivar">@response</span>, <span class="ruby-identifier">exception</span>).<span class="ruby-identifier">out</span>(<span class="ruby-ivar">@output</span>)
189:           <span class="ruby-keyword kw">else</span>
190:             <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span>
191:           <span class="ruby-keyword kw">end</span>
192:         <span class="ruby-keyword kw">end</span>
193:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000476" class="method-detail">
        <a name="M000476"></a>

        <div class="method-heading">
          <a href="#M000476" class="method-signature">
          <span class="method-name">handle_request</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000476-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000476-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 169</span>
169:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_request</span>
170:         <span class="ruby-ivar">@controller</span> = <span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>.<span class="ruby-identifier">recognize</span>(<span class="ruby-ivar">@request</span>)
171:         <span class="ruby-ivar">@controller</span>.<span class="ruby-identifier">process</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-ivar">@response</span>).<span class="ruby-identifier">out</span>(<span class="ruby-ivar">@output</span>)
172:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000477" class="method-detail">
        <a name="M000477"></a>

        <div class="method-heading">
          <a href="#M000477" class="method-signature">
          <span class="method-name">run_callbacks</span><span class="method-args">(kind, enumerator = :each)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000477-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000477-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/dispatcher.rb, line 174</span>
174:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_callbacks</span>(<span class="ruby-identifier">kind</span>, <span class="ruby-identifier">enumerator</span> = <span class="ruby-identifier">:each</span>)
175:         <span class="ruby-identifier">callbacks</span>[<span class="ruby-identifier">kind</span>].<span class="ruby-identifier">send!</span>(<span class="ruby-identifier">enumerator</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">callback</span><span class="ruby-operator">|</span>
176:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">callback</span>
177:           <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Proc</span>; <span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
178:           <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>, <span class="ruby-constant">Symbol</span>; <span class="ruby-identifier">send!</span>(<span class="ruby-identifier">callback</span>)
179:           <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span>; <span class="ruby-identifier">callback</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
180:           <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Unrecognized callback #{callback.inspect}&quot;</span>
181:           <span class="ruby-keyword kw">end</span>
182:         <span class="ruby-keyword kw">end</span>
183:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>